<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>b Statement</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="ScoregensTop.html" title="Score Statements and GEN Routines" />
    <link rel="prev" href="a.html" title="a Statement (or Advance Statement)" />
    <link rel="next" href="e.html" title="e Statement" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">b Statement</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="a.html">Prev</a> </td>
          <th width="60%" align="center">Score Statements and GEN Routines</th>
          <td width="20%" align="right"> <a accesskey="n" href="e.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="b"></a>
      <div class="titlepage"></div>
      <a id="IndexBStatement" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">b Statement</span>
        </h2>
        <p>b Statement — 
      This statement resets the clock.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp212242432"></a>
        <h2>Description</h2>
        <p>
      This statement resets the clock.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp212303728"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>b</strong></span> p1</pre>
      </div>
      <div class="refsect1">
        <a id="idp212305760"></a>
        <h2>Performance</h2>
        <p>
      <span class="emphasis"><em>p1</em></span> -- Specifies how the clock is to be set.
    </p>
        <div class="refsect2">
          <a id="idp212307264"></a>
          <h3>Special Considerations</h3>
          <p>
        p1 is the number of beats by which p2 values of subsequent <span class="emphasis"><em>i statements</em></span> are modified. If p1 is positive, the clock is reset forward, and subsequent notes appear later, the number of beats specified by p1 being added to the note's p2. If p1 is negative, the clock is reset backward, and subsequent notes appear earlier, the number of beats specified by p1 being subtracted from the note's p2. There is no cumulative affect. The clock is reset with each <span class="emphasis"><em>b statement</em></span>. If p1 = 0, the clock is returned to its original position, and subsequent notes appear at their specified p2.
      </p>
        </div>
      </div>
      <div class="refsect1">
        <a id="idp212309936"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the b statement. It uses the file <a class="ulink" href="examples/b.csd" target="_top"><em class="citetitle">b.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp212311792"></a>
          <p class="title">
            <strong>Example 1077. Example of the b statement.</strong>
          </p>
          <div class="example-contents">
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac     <span class="comment">;;;realtime audio out</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if RT audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o b.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100
<span class="ohdr">ksmps</span> <span class="op">=</span> 32
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span>  <span class="op">=</span> 1

<span class="oblock">instr</span> 1

aenv <span class="opc">expseg</span> .01, p3<span class="op">*</span>0.25, 1, p3<span class="op">*</span>0.75, 0.01
asig <span class="opc">poscil3</span> .4<span class="op">*</span>aenv, 220, 1
     <span class="opc">outs</span> asig, asig

<span class="oblock">endin</span>

<span class="oblock">instr</span> 2

asig <span class="opc">pluck</span> 0.7, p4, 220, 0, 1
     <span class="opc">outs</span> asig, asig

<span class="oblock">endin</span>

<span class="oblock">instr</span> 3

asig <span class="opc">loscil</span> .8, 1, 2, 1
     <span class="opc">outs</span> asig, asig

<span class="oblock">endin</span>

<span class="oblock">instr</span> 4
asig  <span class="opc">bamboo</span> .8, 0.01
      <span class="opc">outs</span> asig, asig

<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="stamnt">f</span> 1 0 16384 10 1		<span class="comment">;sine wave</span>
<span class="stamnt">f</span> 2 0 0 1 "<span class="stamnt">f</span>ox.wav" 0 0 0	<span class="comment">;sample</span>

<span class="stamnt">i</span>1  0 2
<span class="stamnt">i</span>1  10 2

<span class="stamnt">b</span> 5			<span class="comment">; set the clock "forward"</span>
<span class="stamnt">i</span>2 1 2 220		<span class="comment">; start time = 6</span>
<span class="stamnt">i</span>2 2 2 110		<span class="comment">; start time = 7</span>

<span class="stamnt">b</span> -1     
<span class="stamnt">i</span>3  3  2		<span class="comment">; start time = 2</span>
<span class="stamnt">i</span>3 5.5 1		<span class="comment">; start time = 4.5</span>


<span class="stamnt">b</span> 0			<span class="comment">; reset clock to normal</span>
<span class="stamnt">i</span>4 10 2			<span class="comment">; start time = 10</span>

<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp212313664"></a>
        <h2>Credits</h2>
        <p>
      Explanation suggested and example provided by Paul Winkler. (Csound Version 4.07)
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="a.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="ScoregensTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="e.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">a Statement (or Advance Statement) </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> e Statement</td>
        </tr>
      </table>
    </div>
  </body>
</html>
